/**
 * @author		Sergey Suzdalskiy
 * @e-mail:		sergey.suzdalskiy@gmail.com
 */
package ua.kiev.gcore.net.connections {
	import flash.events.EventDispatcher;
	import flash.events.TimerEvent;
	import flash.utils.Timer;
	
	import ua.kiev.gcore.net.ServerProxy;
	import ua.kiev.gcore.net.command.Command;
	import ua.kiev.gcore.net.command.IProtocolParser;
	import ua.kiev.gcore.net.connections.event.CommunicateEvent;
	
	public class ServerMockConnection extends Connection {
		
				
		/**
		 * Constructor
		 */
		public function ServerMockConnection(id:int, ca:ConnectionAttributes, parser:IProtocolParser) {
			super(id, ca, parser);
		}
		/**
		 * Connect to mock server
		 */
		override public function init():void {
			
			dispatchEvent(new CommunicateEvent(CommunicateEvent.CONNECT));
		}
		/**
		 * send command
		 * @param command command string
		 */
		override public function sendCommand(command:Command):void {			
			ServerProxy.instance.dataReceivedHandler(command.data, id);
		}
	}
}